package org.zjvis.datascience.common.vo.kg;

import cn.weiguangfu.swagger2.plus.annotation.ApiRequestExclude;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.zjvis.datascience.common.dto.kg.DataPushDTO;
import org.zjvis.datascience.common.dto.kg.KGPanelDTO;
import org.zjvis.datascience.common.util.DozerUtil;
import org.zjvis.datascience.common.vo.BaseVO;

import java.time.LocalDateTime;


/**
 * @description 知识图谱数据推送VO
 * @date 2022-03-28
 */
@Data
@NoArgsConstructor
public class KGPanelVO extends BaseVO {

    private Long id;

    private Long userId;

    private Long vid;

    private Long projectId;

    private JSONObject layout;

    private JSONObject basic;

    private JSONObject publishLayout;

    private int cestatus; //collapse_expand status

    public KGPanelDTO toKGPanel() {
        KGPanelDTO kgp = DozerUtil.mapper(this, KGPanelDTO.class);
        if (null != basic){
            kgp.setInfoBasic(basic.toJSONString());
        }
        if (null != layout){
            kgp.setInfoLayout(layout.toJSONString());
        }
        if (null != publishLayout){
            kgp.setInfoPublishLayout(publishLayout.toJSONString());
        }

        return kgp;
    }
}
